<?php 
	require_once 'Configuration.php';
	require_once LIB_PATH . '/log4php/Logger.php';

	class Configurator implements LoggerConfigurator {
	
	    public function configure(LoggerHierarchy $hierarchy, $input = null) {
	 
	        $layout = new LoggerLayoutTTCC();
	        $layout->setContextPrinting(false);
	        $layout->setDateFormat('%Y-%m-%d %H:%M:%S');
	        $layout->activateOptions();
	        
	        // Create an appender which logs to file
	        $appFile = new LoggerAppenderRollingFile('default');
	        $appFile->setFile(realpath(dirname(__FILE__)) . '/../log/coll_bt.log');
	        $appFile->setMaxFileSize('1MB');
	        $appFile->setMaxBackupIndex(5);
	        $appFile->setAppend(true);
	        $appFile->setLayout($layout);
	        $appFile->setThreshold('info');
	        $appFile->activateOptions();

	        // Add both appenders to the root logger
	        $root = $hierarchy->getRootLogger();
	        $root->addAppender($appFile);
	    }
	}